package com.shao.tactics;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * @author PaoFu
 * @version 1.0
 * 3@data 2025/3/25 16:43
 */
public class Client {
    public static void main(String[] args) {
        double num1 = 2.4, num2 = 3.1;

        // 加法
//        Calculator calculator = new Calculator();
//        Addition addition = new Addition();
//        calculator.setOperation(addition);
//        double result = calculator.execute(num1, num2);
//        System.out.println("result = " + result);
//
//        // 减法
//        Subtraction subtraction = new Subtraction();
//        calculator.setOperation(subtraction);
//        result = calculator.execute(num1, num2);
//        System.out.println("result = " + result);
        new ArrayList<>();
        while (true) {
            Scanner sc = new Scanner(System.in);
            String operator = sc.next();
            Calculator calculator = new Calculator();
            calculator.setOperation(operator);
            double result = calculator.execute(num1, num2);
            System.out.println("result = " + result);
        }
    }
}
